package com.hdu.dwh.service;

import com.hdu.dwh.dtos.DatawarehouseDatabaseDto;
import com.hdu.dwh.exception.DataNotFoundException;
import com.hdu.dwh.pojos.source_access_pojos.DataWarehouseDatabase;
import com.hdu.dwh.pojos.source_access_pojos.DataWarehouseTable;

import java.util.Set;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hdu.dwh.results.ResponseResult;
import com.hdu.dwh.vos.dataWareHouse_vos.DataWarehouseDatabaseDetailVo;

/**
 * <p>
 * 源数据库表 服务类
 * </p>
 *
 * @author bobo
 * @since 2025-04-08
 */
public interface DataWarehouseDatabaseService extends IService<DataWarehouseDatabase> {

    ResponseResult getDetailById(Long id);

    DataWarehouseDatabase queryByNameAndSourceAccessIdAndSourceType(String databaseName, String sourceType, Long sourceAccessId);

    void deleteByDatabaseName(String dbName) throws Exception;

    DataWarehouseDatabase createPaimonDatabase(DatawarehouseDatabaseDto dwhDatabaseDto) throws Exception;

    DataWarehouseDatabase createSourceDatabase(Long sourceAccessId, String sourceDatabase, String sourceType, Integer dataType);

    Set<DataWarehouseDatabaseDetailVo> listDwhDatabaseDetail();

    DataWarehouseDatabase getByDatabaseName(String databaseName);

    DataWarehouseDatabase updateDatabase(Integer id, DatawarehouseDatabaseDto entity) throws Exception;

    DataWarehouseDatabase getByDwhTable(DataWarehouseTable dwhTable) throws DataNotFoundException;
}
